#ifndef __CONFIG_H__
#define __CONFIG_H__

#include <time.h>
#include "dllist.h"

struct _Interface
{
  int nId;
  int nIndex;
  char *pstrDescr;
  char *pstrTitle;
  char *pstrComment;
  char *pstrURL;
  int nPrevOperStatus;
  int nLastOperStatus;
  time_t timeLastPolled;
  time_t timeWhenWentDown;
  time_t timeElapsedToReminder;
};

struct _Device
{
  int nId;
  char *pstrAddress;
  char *pstrCommunity;
  DLLIST dllInterfaces;
};

struct _ConfigData
{
  int nSleepInterval;
  int nMinReminderTime;
  int nMaxReminderTime;
  int bHTMLOutput;
  char *pstrMailEventsFrom;
  char *pstrMailEventsTo;
  char *pstrConfigFile;
  char *pstrWorkingDirectory;
  DLLIST dllDevices;
};

typedef struct _Device DEVICE, *PDEVICE;
typedef struct _Interface INTERFACE, *PINTERFACE;
typedef struct _ConfigData CONFIG_DATA, *PCONFIG_DATA;

extern int Config_Read(PCONFIG_DATA pConfigData, char *pstrConfigFile);
extern void Config_Consolidate(PCONFIG_DATA pConfigDataNew,
                               PCONFIG_DATA pConfigDataOld);

#endif /* __CONFIG_H__ */
